export default [
    {
        path: '/', component: resolve => require.ensure(['../login.vue'], () => {
            resolve(require('../login.vue'))
        }),beforeEnter: (to, from, next) =>{
            if (sessionStorage.getItem('user')){
                next('/vendor')
            }
            next();
        }
    },
    {
        path: '/vendor', component: resolve => require.ensure(['../layout/layout.vue'], () => {
            resolve(require('../layout/layout.vue'))
        }),beforeEnter: (to, from, next) =>{
            if (!sessionStorage.getItem('user')){
                next('/')
            }
            next();
        },children:[
            {
            path: '/', component: resolve => require.ensure(['../user/index.vue'], () => {
                resolve(require('../user/index.vue'))
            }),alias:'pager'
            }
        ]
    }
]